/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import controller.mouseController;
import controller.treeController;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JTree;
import type.mouseType;

/**
 *
 * @author JorgeLuis
 */
public class treeView extends JTree  implements MouseListener{
    private treeController controller;
    private mouseController mouse = new mouseController();

    public treeView() {
        this.addMouseListener(this);
        this.setSize(200,200);
    }

    public void controller(treeController aThis) {
        this.controller = aThis;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (e.getButton() == 1) {mouse.setClickLeft(true);}
        if (e.getButton() == 2) {mouse.setClickCenter(true);}
        if (e.getButton() == 3) {mouse.setClickRigth(true);}
        mouse.setState(mouseType.mouseClicked);
        mouse.setPoint(e.getPoint());
        controller.action( mouse); 
    }

    @Override
    public void mousePressed(MouseEvent me) {
        
    }

    @Override
    public void mouseReleased(MouseEvent me) {
        
    }

    @Override
    public void mouseEntered(MouseEvent me) {
        
    }

    @Override
    public void mouseExited(MouseEvent me) {
        
    }
    
}
